<? if(!defined('IN_ROOT')) exit('Access Denied'); include template('pifaleft'); ?>
<script type="text/javascript">
  	function check_line(){
  	    var tform = document.price_type_form;
  		if(tform.typename.value==""){
  			alert("类型名称不能为空!");
  			tform.typename.focus();
return false;
  		}
  		if (tform.typename.value.length > 6){
alert("价格类型名称不能超过6个字!");
typename.focus();
return false;
}
  		if (tform.price_my.value=="" || tform.price_my.value==0){
  			alert("优惠价不能为空或为零!");
  			tform.price_cncn.focus();
  			return false;
  		}
  		if (tform.descs.value==""){
  			alert("费用说明不能为空!");
  			tform.descs.focus();
  			return false;
  		}
  		if (tform.descs.value.length>2000){
  			alert("费用说明不能超过2000个字!");
  			return false;
  		}
  		tform.submit();
  	}
  	
    function delcfm() {
        if (!confirm("确认要删除该价格类型？")) {
            return false;
        }
    }
    function join_template2(){
  		document.getElementById('descs').value="费用包含：\n费用不包含：\n自费项目说明：";
  	}
</script>
<div class="step">
<ul>
    	<li class="step4"><a href="index.php?line/pifalineedit/<?=$lid?>">1. 基本资料</a></li>
        <li class="step1"><a href="index.php?line/pifalineprice/<?=$lid?>"><span style=" color:#FFF">2. 行程报价</span></a></li>
        <li class="step2"><a href="index.php?line/pifaeditday/<?=$lid?>">3. 具体行程</a></li>
        <li class="step3"><a href="index.php?line/pifaeditdesc/<?=$lid?>">4. 相关指南</a></li>
        <li><img src="css/user/rse.gif" width="87" height="25" /></li>
    </ul>
</div>
<div class="rightmenu"><? if(!$job) { ?><form action="index.php?line/editpricesave" method="post" name="price_type_form" id="price_type_form" >
    <dl>
<dt>价格类型：<em>*</em></dt><dd><input type="text" class="text text100" name="typename" value="" maxlength="6" />
</dd>
</dl>
<dl><dt>门市价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price" id="price" value="" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl><dt>优惠价：<em>*</em></dt><dd><input type="text" class="text text40" name="price_my" id="price_my" value="" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人(报价需为数字整数，若填写虚假价格或不更新，线路将会被直接删除，联盟将不再另行通知 ！) </span></dd></dl>
<dl><dt>儿童价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price_child" id="price_child" value="" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl>
<dt>费用说明：<em>*</em>
<br><span>1000个字以内</span>
<br><span><a href="#" onclick="join_template2();">使用模板</a></span>
</dt><dd class="txtarea"><textarea id="descs" name="descs" class="textarea" cols="" rows=""></textarea></dd>
</dl>
<dl><dt>排序：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="views" value="99" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/> <span>价格类型排序，从小到大排，最大值100</span></dd></dl>
<dl><dt>跳转：<em>&nbsp;</em></dt><dd><input type="radio" value="1" name="tz">继续编辑&nbsp;<input type="radio" value="2" name="tz" checked>编辑行程</dd></dl>
  		<div class="adsubdiv"><img src="<?=SITE_URL?>css/user/adminsub.gif" width="109" height="32"  onclick="check_line();"/></div>
  		<input type="hidden" value="<?=$lid?>" name="lid" /></form>	
    <? } elseif($job =='edit') { ?>    <form action="index.php?line/editpriceedit" method="post" name="price_type_form" id="price_type_form" enctype="multipart/form-data">
<dl>
<dt>价格类型：<em>*</em></dt><dd><input type="text" class="text text100" name="typename" value="<?=$dp['typename']?>" maxlength="6" />
</dd>
</dl>
<dl><dt>门市价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price" id="price" value="<?=$dp['price']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl><dt>优惠价：<em>*</em></dt><dd><input type="text" class="text text40" name="price_my" id="price_my" value="<?=$dp['price_my']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人(报价需为数字整数，若填写虚假价格或不更新，线路将会被直接删除，联盟将不再另行通知 ！) </span></dd></dl>
<dl><dt>儿童价：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="price_child" id="price_child" value="<?=$dp['price_child']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/><span> 元/人</span></dd></dl>
<dl>
<dt>费用说明：<em>*</em>
<br><span>1000个字以内</span>
<br><span><a href="#" onclick="join_template2();">使用模板</a></span>
</dt><dd class="txtarea"><textarea id="descs" name="descs" class="textarea" cols="" rows=""><?=$dp['descs']?></textarea></dd>
</dl>
<dl><dt>排序：<em>&nbsp;</em></dt><dd><input type="text" class="text text40" name="views" value="<?=$dp['views']?>" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"/> <span>价格类型排序，从小到大排，最大值100</span></dd></dl>
<dl><dt>跳转：<em>&nbsp;</em></dt><dd><input type="radio" value="1" name="tz" checked>继续编辑&nbsp;<input type="radio" value="2" name="tz">编辑行程</dd></dl>
<div class="adsubdiv"><img src="<?=SITE_URL?>css/user/adminsub.gif" width="109" height="32"  onclick="check_line();"/></div>	
<input type="hidden" value="<?=$lid?>" name="lid" />
<input type="hidden" value="<?=$pid?>" name="pid" />
</form>
    <? } ?><div id="tab" class="tab_box">
<table width="778" border="0" cellspacing="0" cellpadding="0" class="tab">
  <tr>
    <th width="15%" align="center">价格类型</th>
    <th width="10%" align="center">门市价</th>
    <th width="10%" align="center">优惠价</th>
    <th width="10%" align="center">儿童价</th>
    <th width="15%" align="center">指定日期报价</th>
    <th width="6%" align="center">排序</th>
    <th width="15%" align="center">操作</th>
  </tr>
  
<? if(is_array($list)) { foreach($list as $line) { ?>
    <tr>
    <td align="center"><?=$line['typename']?></td>
    <td align="center"><?=$line['price']?></td>
    <td align="center"><?=$line['price_my']?></td>
    <td align="center"><?=$line['price_child']?></td>
    <td align="center"><a href="#">编辑日期</a></td>
    <td align="center"><?=$line['views']?></td>
    <td align="center"><a href="index.php?line/pifalineprice/<?=$lid?>/edit/<?=$line['id']?>">修改</a>
    <? if($line['isdef']==0) { ?>  <a href="index.php?line/delprice/<?=$lid?>/<?=$line['id']?>" onclick="return delcfm()">删除</a><? } ?>    </td>
  </tr>
  
<? } } ?>
  </table>
</div>
</div>
<!-- bottom-->
<? include template('footer'); ?>
